#region Copyright (c) 2006 Jonathan Naumann
/*       _\|/_
         (o o)
+-----oOO-{_}-OOo-----------------------+
| Copyright (c) Jonathan Naumann        |
+---------------------------------------+
| 
| File: MonoPad.FileHandler.cs
| Version:	0.1.1
+
*/
#endregion

using System;
using System.IO;

namespace MonoPad {
	///
	/// Class file handler
	///
	public class FileHandler {
		private FileContainer fc = new FileContainer();
		
		///
		/// Default constructor
		///
		public FileHandler() {
		}
		
		///
		/// Specific constructor
		///
		public FileHandler(string Filename) {
			fc.Filename = Filename;
		}
		
		///
		/// Save a file
		///
		public void SaveFile(string Content) {
			fc.Filename = fc.Filename.Replace("file://", "");
			
			//fc.Filestream.Write
			
			StreamWriter sw = new StreamWriter(
				fc.Filename, 
				false
			);
			
			sw.Write(Content);
			sw.Flush();
			
			sw.Close();
			//fc.Filestream.Close();
		}
	}
	
}
